SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwlLiquidacionByPa
AS
SELECT dbo.tb_BecasYPrestamos.idBeca AS ID, dbo.vwrAlumnos.Descripcion AS Nombres, dbo.tb_LiquidacionBYP.Descripcion AS Liquidacion, 
               dbo.tb_LiquidacionBYP.Año, dbo.tb_LiquidacionBYP.Pagado, dbo.tb_MovimientosBYP.Monto, dbo.tb_MovimientosBYP.Fecha, 
               dbo.vwrTiposDeMovimiento.Descripcion AS TipoMovim, dbo.tb_BecasYPrestamos.Alumno
FROM  dbo.tb_BecasYPrestamos INNER JOIN
               dbo.vwrAlumnos ON dbo.tb_BecasYPrestamos.Alumno = dbo.vwrAlumnos.ID INNER JOIN
               dbo.tb_MovimientosBYP ON dbo.tb_BecasYPrestamos.idBeca = dbo.tb_MovimientosBYP.IdBecaYPrestamo INNER JOIN
               dbo.tb_LiquidacionBYP ON dbo.tb_MovimientosBYP.LiquidacionByP = dbo.tb_LiquidacionBYP.idLiquidacionByP INNER JOIN
               dbo.vwrTiposDeMovimiento ON dbo.tb_MovimientosBYP.IdTipoDeMovimiento = dbo.vwrTiposDeMovimiento.Id
GO
GRANT SELECT ON  [dbo].[vwlLiquidacionByPa] TO [Becas]
GRANT SELECT ON  [dbo].[vwlLiquidacionByPa] TO [SoloVer]
GO
